import request from '@/config/axios'

export interface ConsentTemplateVO {
  id?: number
  formName: string
  formVersion: string
  contentHtml: string
  contentText: string
  isActive: boolean
  effectiveDate: string
  expiryDate: string
  creator: string
  createTime?: Date
  updateTime?: Date
}

export const consentTemplateActive = async () => {
  return await request.post({ url: `/system/consentTemplate/listActive` })
}

// 查询知情同意书模板分页
export const getConsentTemplatePage = async (params: any) => {
  return await request.get({ url: '/system/consentTemplate/page', params })
}

// 查询知情同意书模板详情
export const getConsentTemplate = async (id: number) => {
  return await request.get({ url: `/system/consentTemplate/getById?id=${id}` })
}

// 新增知情同意书模板
export const createConsentTemplate = async (data: ConsentTemplateVO) => {
  return await request.post({ url: '/system/consentTemplate/create', data })
}

// 修改知情同意书模板
export const updateConsentTemplate = async (data: ConsentTemplateVO) => {
  return await request.post({ url: '/system/consentTemplate/update', data })
}

// 删除知情同意书模板
export const deleteConsentTemplate = async (id: number) => {
  return await request.post({ url: `/system/consentTemplate/delete?id=${id}` })
}




